/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * TelaBuscarFoto.java
 *
 * Created on 26/10/2010, 23:45:02
 */
package asfabdesk.apresentacao;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JFileChooser;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;

/**
 *
 * @author marco.machado
 */
public class  TelaBuscarFoto extends javax.swing.JInternalFrame {

    /** Creates new form TelaBuscarFoto */
    public TelaBuscarFoto() {
        initComponents();

    }

    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new TelaBuscarFoto().setVisible(true);
            }
        });
    }
    
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        fc = new javax.swing.JFileChooser();

        setClosable(true);
        setName("Form"); // NOI18N

        fc.setName("fc"); // NOI18N
        fc.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                fcActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(fc, javax.swing.GroupLayout.DEFAULT_SIZE, 592, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(fc, javax.swing.GroupLayout.DEFAULT_SIZE, 431, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void fcActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_fcActionPerformed
        if (evt.getActionCommand().equals("CancelSelection")) {
            System.out.printf("CancelSelection\n");            
            this.setVisible(false);
            this.dispose();
        }
        if (evt.getActionCommand().equals("ApproveSelection")) {
            System.out.printf("ApproveSelection\n");
            System.out.println("File escolhido absolute path: " + fc.getSelectedFile().getAbsolutePath());
            System.out.println("File escolhido path: " + fc.getSelectedFile().getPath());
            this.setVisible(false);
            this.dispose();
        }
    }//GEN-LAST:event_fcActionPerformed
    // Variables declaration - do not modify//GEN-BEGIN:variables
    public static javax.swing.JFileChooser fc;
    // End of variables declaration//GEN-END:variables
}
